package ontology;

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

/**
 * This class is used to parse the 'frame-relation' elements of 
 * the relations file (frXML/frRelation.xml) in the FrameNet ontology.
 * These elements have the following format:
 * 
 * frame-relation @superFrameName @subFrameName
 *   > fe-relation*
 *
 */

public class FrameRelation {
	
	public String superFrameName;
	public String subFrameName;
	public List<FERelation> feLinks = new ArrayList<FERelation>();
	
	public FrameRelation(Element e) {
		superFrameName = e.getAttribute("superFrameName");
		subFrameName = e.getAttribute("subFrameName");		
		NodeList ns = e.getChildNodes();
		for (int i=0;i<ns.getLength();i++) {
			Node n = ns.item(i);
			String s = n.getNodeName();
			if (s.equals("fe-relation")) {
				feLinks.add(new FERelation((Element) n));
			}
		}
	}
	
	
	
	
}
